import { Injectable } from '@angular/core';
import { BaseHttpService } from './base-http.service';
import { Observable } from 'rxjs';

@Injectable({
	providedIn: 'root'
})
export class TaskService {

	private readonly COMM_URL = '/task';
	constructor(private http: BaseHttpService) { }

  //任务列表
  tasks(): Observable<any> {
    return this.http.get(`${this.COMM_URL}/tasks`);
  }

  /**
   * 惦记阅读文章
   * @param uid
   */
  readTasks(uid: string): Observable<any> {
    return this.http.get(`${this.COMM_URL}/readTasks?uid=${uid}`);
  }

  /**
   * 15秒完成阅读请求该接口
   * @param uid
   */
  applyTask(uid: string): Observable<any> {
    return this.http.get(`${this.COMM_URL}/readTasks?uid=${uid}`);
  }
}
